package com.project.junM.service.impl;

import com.project.junM.entity.TMember;
import com.project.junM.entity.TMemberMedicalhistory;
import com.project.junM.mapper.TMemberMedicalhistoryMapper;
import com.project.junM.service.MemberMedicalhistoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpSession;

@Service
public class MemberMedicalhistoryServiceImpl implements MemberMedicalhistoryService {

    @Autowired
    private TMemberMedicalhistoryMapper tMemberMedicalhistoryMapper;


    @Override
    public TMemberMedicalhistory selectByMemberId(HttpSession session) {
        TMember user = (TMember)session.getAttribute("user");

        return tMemberMedicalhistoryMapper.selectByMemberId(user.getId());
    }
}
